package com.qs.user.ui.activity;

import android.os.Bundle;
import android.os.Environment;
import android.view.View;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.qs.base.base.BaseMyActivity;
import com.qs.base.router.RouterActivityPath;
import com.qs.user.BR;
import com.qs.user.R;
import com.qs.user.databinding.UserIdentifyHistoricalActivityBinding;
import com.qs.user.ui.VM.IdentifyHistoricalItemViewModel;
import com.qs.user.ui.VM.IdentifyHistoricalViewModel;
import com.qs.base.utils.FileUtil;

/**
 * 识别历史
 *
 * @Author ltzz
 * @Date 2019/8/24
 */
@Route(path = RouterActivityPath.User.IDENTIFY_HISTORICAL_ACTIVITY)
public class IdentifyHistoricalActivity extends BaseMyActivity<UserIdentifyHistoricalActivityBinding, IdentifyHistoricalViewModel> {
    @Override
    protected boolean statusBarDarkFont() {
        return true;
    }

    @Override
    protected View titleLayout() {
        return binding.head;
    }

    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.user_identify_historical_activity;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        viewModel.imgs = FileUtil.getHistorImg(Environment.getExternalStorageDirectory().getAbsolutePath() + "/image/");
        if (viewModel.imgs != null && viewModel.imgs.size() > 0) {
            for (int i = 0; i < viewModel.imgs.size(); i++) {
                viewModel.observableList.add(new IdentifyHistoricalItemViewModel(viewModel, viewModel.imgs.get(i)));
            }
        }
    }
}
